<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>

        This text above will not be displayed.

        <ui:composition template="/resource/facelets/layout.xhtml">

            <ui:define name="top">
                Texto no topo
            </ui:define>

            <ui:define name="left">
                Menu<br/>
                Teste
            </ui:define>

            <ui:define name="content">
                <f:view id="view">
                    <h:form id="contentForm">

                        <h:commandLink value="Populate DB" action="#{populatorMB.populateDB}"/>

                        <br/><br/><br/>

                        <h:commandLink value="List Users" action="#{userMB.listUsersOnServer}"/>

                        <br/>

                        <h1><h:outputText value="List"/></h1>
                        <h:dataTable value="#{userMB.users}" var="item"
                              styleClass="dataTable"
                             headerClass="dataTableHeader"
                             rowClasses="dataTableRowOdd,dataTableRowEven"
                             cellpadding="2">
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="UserId"/>
                                </f:facet>
                                <h:outputText value="#{item.userId}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Email"/>
                                </f:facet>
                                <h:outputText value="#{item.email}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Password"/>
                                </f:facet>
                                <h:outputText value="#{item.password}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Username"/>
                                </f:facet>
                                <h:outputText value="#{item.username}"/>
                            </h:column>
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Ações"/>
                                </f:facet>
                                <h:commandLink value="Visualizar" action="#{userMB.selectUser(item)}"/>
                            </h:column>



                        </h:dataTable>


                    </h:form>
                </f:view>
            </ui:define>

        </ui:composition>

    </body>
</html>

